import React, { Component } from "react";

export default class Item extends Component {
  changeStatus = (id) => (e) => {
    console.log('当前的状态',e,id,e.target.checked);
    this.props.changeStatus(id,e.target.checked)
  }
  del = () => {
    this.props.delList(this.props.id)
  }
  render() {
    return (
      <div className="item">
        <div className="left">
          <input type="checkbox" checked={this.props.status} onChange={this.changeStatus(this.props.id)} />
          <span>{this.props.task}</span>
        </div>
        <button onClick={this.del}>del</button>
      </div>
    );
  }
}
